package com.tcm.pay.dao.mapper;


import com.tcm.pay.entity.Payment;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface PaymentMapper {
    int deleteByUserId(@Param("userId") Long userId,
                       @Param("orderId") Long orderId,
                       @Param("tradeType") String tradeType);

    int insert(Payment record);

    Payment findByOrderId(@Param("userId") Long userId,
                          @Param("orderId") Long orderId,
                          @Param("tradeType") String tradeType);


    List<Payment> listPageByUserId(@Param("userId") Long userId,
                                   @Param("tradeType") String tradeType,
                                   @Param("offset") Long offset,
                                   @Param("pagesize") Long pagesize);

    Long countByUserId(@Param("userId") Long userId,
                  @Param("tradeType") String tradeType);

    int update(Payment record);

    void updateStatus(Payment payment);

    Payment findByPaySn(@Param("paySn")String paySn, @Param("tradeType") String tradeType);
}